import { IParam, EntityBase } from "@/core";
import { IIBIZAPPVIEW } from './interface/i-ibizappview';
import IBIZAPPVIEWKeys from './ibizappview-keys';

/**
 * 应用视图基类
 * 基于template/src/api/{{appEntities}}/{{appEntities}}-base.ts.hbs生成  
 *
 * @export
 * @abstract
 * @class IBIZAPPVIEWBase
 * @extends { EntityBase }
 * @implements { IIBIZAPPVIEW }
 */
export abstract class IBIZAPPVIEWBase extends EntityBase implements IIBIZAPPVIEW {
	/**
	 * 实体名称
	 *
	 * @readonly
	 * @type {string}
	 * @memberof IBIZAPPVIEWBase
	 */
	get srfdename(): string {
		return 'IBIZAPPVIEW';
	}

	/**
     * 当前实体所有属性
     *
     * @protected
     * @type {string[]}
     * @memberof IBIZAPPVIEWBase
     */
    protected get keys(): string[] {
        return IBIZAPPVIEWKeys;
    }

	/**
	 * Creates an instance of ConstactOppoBase.
	 * @param {*} [data]
	 * @memberof IBIZAPPVIEWBase
	 */
	constructor(data?: any) {
		super();
		this.setData(data);
	}

	/**
	 * 建立人
	 **/
	createman?: any;
	
	/**
	 * 建立时间
	 **/
	createdate?: any;
	
	get srfmajortext(): string {
		return this.ibizappviewname;
	}

	set srfmajortext(val: string) {
		this.ibizappviewname = val;
	}
	/**
	 * 应用视图名称
	 **/
	ibizappviewname?: any;
	
	get srfkey(): string {
		return this.ibizappviewid;
	}

	set srfkey(val: string) {
		this.ibizappviewid = val;
	}

	/**
	 * 应用视图标识
	 **/
	ibizappviewid?: any;
	
	/**
	 * 更新人
	 **/
	updateman?: any;
	
	/**
	 * 更新时间
	 **/
	updatedate?: any;
	
	/**
	 * 应用视图类型
	 **/
	ibizappviewtype?: any;
	
	/**
	 * 文档地址
	 **/
	documentaddress?: any;
	
	/**
	 * 示例地址
	 **/
	instanceaddress?: any;
	
	/**
	 * 视图描述
	 **/
	viewdescription?: any;
	
	/**
	 * 数量
	 **/
	amount?: any;
	

	/**
	 * 重置实体数据
	 *
	 * @param {IParam} [data={}]
	 * @memberof IBIZAPPVIEWBase
	 */
	reset(data: IParam = {}): void {
		super.reset(data);
		this.ibizappviewname = data.ibizappviewname || data.srfmajortext;
		this.ibizappviewid = data.ibizappviewid || data.srfkey;
	}
}